homeworkHomework#Your homework for Arrays session is to write a calculator function that takes at least three parameters and does some mathematical operations:#function calculator([num, op, num, op, num,]) { // Your Code goes here}; calculator([2, '+' , 4]); // 2 + 4 = 6calculator([2, '+', 4, '-', 1, '*', 3 ]) // 2 + 4 - (1 * 3) = 3CopyFeel free to rename the function and parameters as you like.#